//
// Calc.hh for calc 206 in /home/druart_p/Work/math/my-math-epi/206
//
// Made by pierrick druart
// Login   <druart_p@epitech.net>
//
// Started on  Wed May  9 14:47:04 2012 pierrick druart
// Last update Sun May 13 20:52:30 2012 pierrick druart
//

#ifndef		__CALC__
#define		__CALC__

#include	<iostream>
#include	<list>
#include	<fstream>
#include	<sstream>
#include	<iomanip>
#include	<cmath>

class		Calc
{
private:
  std::list<std::string> value;
  double       	ari;
  double       	quadra;
  double	geo;
  double       	harmo;
  double	med;
  double	mod;
  double	var;
  double	eMoy;
  double	eMed;
  double	tmp2;
  double	max;
  int		tmp;
  int		total;

public:
  Calc(const std::string & file);
  ~Calc();

private:
  void		getValueFromFile(const std::string & file);
  void       	lexValue();
  void		affRes();
  void		init();
  void		repartition(int val, int eff);

private:
  void		moyenneArithmetique(int val, int eff);
  void		moyenneQuadratique(int val, int eff);
  void		moyenneGeometrique(int val, int eff);
  void		moyenneHarmonique(int val, int eff);
  double       	mediane();
  void		mode(int val, int eff);
  void		variance(int val, int eff);
  double       	ecartMoyen(double arit);
  double       	ecartMedian(double medi);
};

#endif		/* __CALC__ */
